/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package engine;

/**
 * This class defines a vector
 * in 3 dimensions, x, y, and z.
 * @author &{user}
 */
public class Vector3d {
    
    public float x,y,z;
    
    public Vector3d(float x,float y,float z){
	this.x = x;
	this.y = y;
	this.z = z;
    }
    
    public Vector3d(Vector3d v){
	this(v.x,v.y,v.z);
    }
    
    public Vector3d(){
	this(0,0,0);
    }
    
    public void set(Vector3d v){
	this.x = v.x;
	this.y = v.y;
	this.z = v.z;
    }
    
    public float getLengthSQ(){
	return x * x + y * y + z * z;
    }
    
    public float getLength(){
	return (float)Math.sqrt(getLengthSQ());
    }
    
}
